package br.ufrgs.tst.tsp.model;

import java.util.LinkedList;
import java.util.List;

import junit.framework.Assert;

import org.junit.Before;
import org.junit.Test;

import br.ufrgs.tsp.model.ICity;
import br.ufrgs.tsp.model.ModelFactory;

public class TestCity {

	private static final int CITY_ID = 0;
	private ModelFactory modelFactory;
	private ICity city;

	@Before
	public void setUp() {
		modelFactory = ModelFactory.getInstance();
		city = modelFactory.createCity(CITY_ID);
	}

	@Test
	public void doNotHaveNeigboardsTest() {
		Assert.assertFalse(city.hasNeigboards());
	}

	@Test
	public void getNeigboardsCountEqualsToZeroTest() {
		Assert.assertTrue(city.getNeigboardsCount() == 0);
	}

	@Test
	public void hasNeigboardsTest() {
		List<ICity> neigboards = new LinkedList<ICity>();
		neigboards.add(modelFactory.createCity());
		neigboards.add(modelFactory.createCity());
		city = ModelFactory.getInstance().createCity(CITY_ID, neigboards);
		
		Assert.assertTrue(city.hasNeigboards());
	}
}
